package com.starbaba.system.common;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.starbaba.core.service.CommonService;

/**
 * 创建VO任务
 *
 * @Copyright: Copyright (c) 2006
 * @Company: Revenco Tech Ltd.
 * @anthor chenminhui<chenminhui@revenco.com>
 * @since 2014-9-12 下午02:53:17
 * @version V1.0
 */
public class CreateVoTask implements Runnable {
	
	private Log log = LogFactory.getLog(getClass());
	
	private CommonService service;
	private Object vo;
	
	public CreateVoTask(CommonService service, Object vo) {
		this.service = service;
		this.vo = vo;
	}
	
	@Override
	public void run() {
		if(service == null) {
			log.error("service为空");
			return;
		}
		if(vo == null) {
			log.error("vo对象为空");
			return;
		}
		
		try {
			service.doCreate(vo.getClass(), vo);
		} catch (Exception e) {
			log.error("操作VO对象失败，异常信息：", e);
		}
	}
	
}
